/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.usfirst.frc675.Fred;

import java.util.Vector;

/**
 *
 * @author TJ
 */
public abstract class CommandReceiver {
    public class Command {
        private String name;
        private Vector arguments;

        public Command(String name, Vector arguments) {
            this.name = name;
            this.arguments = arguments;
        }

        public String toString() {
            String out = name + " ";
            for(int a = 0; a < arguments.size(); a++) {
                out += arguments.elementAt(a) + " ";
            }
            return out;
        }

        public String getName() {
            return name;
        }

        public String getArgument(int index) {
            return (String) arguments.elementAt(index);
        }
    }

    // Returns true if there is a new command available
    public abstract boolean isCommandAvailable();

    // Returns the next available Command or NULL if none are available
    public abstract Command pollCommand();
}
